<div ms-important="vm-promot_codelist">
    <div class="user-r-title clearfix">
        <div class="common-title f-l">
            <span class="field">推广码列表</span>
        </div>
        <a  class="btn btn-primary btn-m f-r" id="btn_upload" ms-click="popCreateQrCode" style="position: relative; z-index: 1;">创建推广码</a>
    </div>
    <div class="user-r-content clearfix j-ajax-page">
        <div class="search clearfix">
            <div class="search-list">
                <span>推广码标题</span>
                <input type="text" ms-duplex="@search_data.code_name" placeholder="">
            </div>
            <div class="search-list">
                <span>推广码状态</span>
                <select ms-duplex="@search_data.code_state">
                    <option value="-1" {if $data.is_effect eq -1}selected="selected"{/if}>全部</option>
                    <option value="1" {if $data.is_effect eq 1}selected="selected"{/if}>开启</option>
                    <option value="0" {if $data.is_effect eq 0}selected="selected"{/if}>关闭</option>
                </select>
            </div>
            <a href="javascript:void(0)" class="btn btn-primary btn-circle" ms-click="search">搜索</a>
        </div>
        <div class="ajax-block">
            <table class="uc-table">
                <thead>
                    <tr>
                        <th>推广码ID</th>
                        <th>邀请码标题</th>
                        <th>推广注册会员数</th>
                        <th>状态</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {foreach from="$data.promot_codelist" item="code" key="key"}
                    <tr>
                        <td>{$code.id}</td>
                        <td>{$code.name}</td>
                        <td>{$code.qrcode_user_num}<a href='{url r="user#promoter_userlist" p="bm_qrcode_id=$code.id"}' class="table-link">明细</a></td>
                        <td><span class="table-link" ms-click="changeCodeEffect({$code.id},$event)">{if $code.is_effect eq 1}开启{else}关闭{/if}</span></td>
                        <td>{function name="to_date" v="$code.create_time"}</td>
                        <td><a class="table-link" ms-click="viewQrCode('{$code.img}','{$code.name}')">查看二维码</a></td>
                    </tr>
                    {foreachelse}
                    <tr>
                        <td colspan="6">
                            <span>暂无数据</span>
                        </td>
                    </tr>
                    {/foreach}
                </tbody>
            </table>
            <div class="m-page clearfix">
                <div class="m-page-con">
                    {$data.page}
                </div>
            </div>
        </div>
    </div>
</div>
